﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TodoApp.ResultModel;
using TodoApp.TMS_personnelmatters.Employeess;
using Volo.Abp.Application.Services;

namespace TodoApp.TMS_SetUp.Operators
{
    public class TMS_OperatorService: ApplicationService
    {
        private readonly ITMS_OperatorRepository _tMS_OperatorRepository;
        public TMS_OperatorService(ITMS_OperatorRepository tMS_OperatorRepository)
        {
            _tMS_OperatorRepository = tMS_OperatorRepository;
        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        public async Task<PageResponse<TMS_OperatorDto>> GetOperator(string serialNumber, string name, int pageindex, int pagesize)
        {
            return await _tMS_OperatorRepository.GetOperator(serialNumber, name, pageindex, pagesize);
        }
        /// <summary>
        /// 显示员工
        /// </summary>
        /// <returns></returns>
        public async Task<List<TMS_Employees>> GetTMS_Employees()
        {
            return await _tMS_OperatorRepository.GetTMS_Employees();
        }
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="tMS_Operator"></param>
        /// <returns></returns>
        public async Task<ResponseModel<TMS_OperatorDto>> GetLogan(string account, string password)
        {
            return await _tMS_OperatorRepository.GetLogan(account,password);
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="tMS_Operator"></param>
        /// <returns></returns>
        public async Task<int> CreateOperator(TMS_Operator tMS_Operator)
        {
            return await _tMS_OperatorRepository.CreateOperator(tMS_Operator);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="tMS_Employees"></param>
        /// <returns></returns>
        public async Task<int> UpdateOperator(TMS_OperatorDto tMS_Operator)
        {
            return await _tMS_OperatorRepository.UpdateOperator(tMS_Operator);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> DeleteOperator(string id)
        {
            return await _tMS_OperatorRepository.DeleteOperator(id);
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<ResponseModel<TMS_OperatorDto>> GetFindById(string id)
        {
            return await _tMS_OperatorRepository.GetFindById(id);
        }
        /// <summary>
        /// 编辑操作员
        /// </summary>
        /// <param name="name"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> UpdatePhone(string name, string id)
        {
            return await _tMS_OperatorRepository.UpdatePhone(name, id);
        }
    }
}
